//
//  MessageViewController.m
//  網易
//
//  Created by 赵天宇 on 16/9/17.
//  Copyright © 2016年 赵天宇. All rights reserved.
//

#import "MessageViewController.h"

@interface MessageViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>{
    UILabel *labTitle;
    UITextField *tt;
    UITextField *ff;
    UIButton *sub;
    UILabel *underImage;
    UIButton *imageV;
    UIImagePickerController *pickCon;
}

@end

@implementation MessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    labTitle = [[UILabel alloc]initWithFrame:CGRectMake(70, 74, 300, 10)];
    labTitle.text=@"设备:iPhone 系统:9.1 客户端版本:15.0";
    [self.view addSubview:labTitle];
    tt=[[UITextField alloc]initWithFrame:CGRectMake(10, 90, 370, 200)];
    tt.placeholder=@"请写下您的建议（不少于10字）";
    [self.view addSubview:tt];
    tt.layer.borderWidth=1;
    ff=[[UITextField alloc]initWithFrame:CGRectMake(10, 300, 370, 40)];
    ff.placeholder=@"请输入您的手机或邮箱";
    [self.view addSubview:ff];
    sub = [UIButton buttonWithType:0];
    sub.backgroundColor = [UIColor redColor];
    [sub setTitle:@"提交" forState:0];
    [sub addTarget:self action:@selector(click_1) forControlEvents:UIControlEventTouchUpInside];
    sub.frame=CGRectMake(10, 380, 370, 40);
    [sub setTitleColor:[UIColor whiteColor] forState:0];
    [self.view addSubview:sub];
    imageV =[UIButton buttonWithType:0];
    [imageV setBackgroundImage:[UIImage imageNamed:@"usercenter_hd_camera.png"] forState:0];
    [imageV addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    imageV.frame=CGRectMake(320, 90, 50, 30);
    [self.view addSubview:imageV];
    underImage = [[UILabel alloc]initWithFrame:CGRectMake(320, 125, 60, 20)];
    underImage.text=@"添加图片";
    underImage.font = [UIFont systemFontOfSize:14];
    underImage.textColor=[UIColor lightGrayColor];
    [self.view addSubview:underImage];
    pickCon = [[UIImagePickerController alloc]init];
    pickCon.delegate=self;
    
    // Do any additional setup after loading the view.
}
-(void)click
{
    pickCon.allowsEditing = YES;
    [self presentViewController:pickCon animated:YES completion:nil];
}
-(void)click_1{
    [[[UIAlertView alloc]initWithTitle:@"提交成功" message:nil delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil] show];
    
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{
    [self dismissViewControllerAnimated:YES completion:nil];

}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
    [self dismissViewControllerAnimated:YES completion:nil];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
